#ifndef DODO_PLAYSOUND_H
#define DODO_PLAYSOUND_H
#include <unistd.h>

#include "organdef.h"

void PlaySound(int dsp_fd, int buf_size, smpl_t *buf1 , smpl_t *buf2, int *buf_flag, int *gen_flag, int *on_sig)
{

	int buf_len = buf_size * sizeof(smpl_t); // short: 2, 24bit: 3?
	while( *on_sig )
	{
	    if( *gen_flag == 2)
	    {
            *buf_flag = 1;
            write( dsp_fd, buf1, buf_len);
	    }
	    else
	    {
            *buf_flag = 2;
            write( dsp_fd, buf2, buf_len);
	    }
	}
}

#endif

